home *** CD-ROM | disk | FTP | other *** search
/ Network PC / Network PC.iso / amiga utilities / communication / internet / amitcp3.0b / src.lha / src / amitcp / sys / systm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-08  |  5.9 KB  |  174 lines

  1. /*
  2.  * $Id: systm.h,v 1.18 1994/02/15 23:15:49 jraja Exp $
  3.  *
  4.  * Copyright (c) 1993 AmiTCP/IP Group, <amitcp-group@hut.fi>
  5.  *                    Helsinki University of Technology, Finland.
  6.  *                    All rights reserved.
  7.  *
  8.  * HISTORY
  9.  * $Log: systm.h,v $
  10.  * Revision 1.18  1994/02/15  23:15:49  jraja
  11.  * Added prototypes for cs_putchar() and csprintn(),
  12.  * changed vlog() to return the length (unsigned long).
  13.  *
  14.  * Revision 1.17  1993/11/07  00:05:41  ppessi
  15.  * Added csprintf(), vsprintf() and vcsprintf() functions.
  16.  *
  17.  * Revision 1.16  1993/06/04  11:16:15  jraja
  18.  * Fixes for first public release.
  19.  *
  20.  * Revision 1.15  1993/05/17  01:02:04  ppessi
  21.  * Changed RCS version
  22.  *
  23.  * Revision 1.14  1993/04/28  13:01:01  puhuri
  24.  * Fixed stdargs.h to stdarg.h
  25.  *
  26.  * Revision 1.13  93/04/27  10:27:58  10:27:58  puhuri (Markus Peuhkuri)
  27.  * Add prototype for vlog().
  28.  * 
  29.  * Revision 1.12  93/03/12  23:57:26  23:57:26  ppessi (Pekka Pessi)
  30.  * Fixed logging function prototypes
  31.  * 
  32.  * Revision 1.11  93/03/11  17:02:13  17:02:13  jraja (Jarno Tapio Rajahalme)
  33.  * Changed back to c types, removed obsolete stuff.
  34.  * 
  35.  * Revision 1.10  93/03/10  17:16:57  17:16:57  puhuri (Markus Peuhkuri)
  36.  * Fixed function prototypes (for kern/subr_prf.c/1.12)
  37.  * 
  38.  * Revision 1.9  93/03/05  03:29:43  03:29:43  ppessi (Pekka Pessi)
  39.  * Compiles with SASC. Initial test version.
  40.  * 
  41.  * Revision 1.8  93/03/03  15:50:23  15:50:23  jraja (Jarno Tapio Rajahalme)
  42.  * Cleanup.
  43.  * 
  44.  * Revision 1.7  93/02/25  19:14:05  19:14:05  ppessi (Pekka Pessi)
  45.  *     Fixed bug with queue_node.
  46.  * 
  47.  * Revision 1.6  93/02/25  19:09:17  19:09:17  puhuri (Markus Peuhkuri)
  48.  * fixed defination of log, panic, printf and add kprintf.
  49.  * 
  50.  * Revision 1.5  93/02/24  11:16:19  11:16:19  jraja (Jarno Tapio Rajahalme)
  51.  * Changed path uxkern to kern.
  52.  * 
  53.  * Revision 1.4  93/02/04  18:22:16  18:22:16  jraja (Jarno Tapio Rajahalme)
  54.  * Cleaned up _insque and _remque definitions.
  55.  * Commented out some obsolete definitions.
  56.  * 
  57.  * Revision 1.3  93/01/06  19:16:57  19:16:57  jraja (Jarno Tapio Rajahalme)
  58.  * Added inline definitions for _insque and _remque.
  59.  * Also added #include <uxkern/amiga_subr.h> for bcmp(), bcopy() and bzero()
  60.  * definitions.
  61.  * 
  62.  * Revision 1.2  92/11/20  15:57:06  15:57:06  jraja (Jarno Tapio Rajahalme)
  63.  * Added #ifndef AMITCP's to make this compile.
  64.  * 
  65.  * Revision 1.1  92/11/20  15:48:10  15:48:10  jraja (Jarno Tapio Rajahalme)
  66.  * Initial revision
  67.  * 
  68.  */
  69.  
  70. /*-
  71.  * Copyright (c) 1982, 1988, 1991 The Regents of the University of California.
  72.  * All rights reserved.
  73.  *
  74.  * Redistribution and use in source and binary forms, with or without
  75.  * modification, are permitted provided that the following conditions
  76.  * are met:
  77.  * 1. Redistributions of source code must retain the above copyright
  78.  *    notice, this list of conditions and the following disclaimer.
  79.  * 2. Redistributions in binary form must reproduce the above copyright
  80.  *    notice, this list of conditions and the following disclaimer in the
  81.  *    documentation and/or other materials provided with the distribution.
  82.  * 3. All advertising materials mentioning features or use of this software
  83.  *    must display the following acknowledgement:
  84.  *    This product includes software developed by the University of
  85.  *    California, Berkeley and its contributors.
  86.  * 4. Neither the name of the University nor the names of its contributors
  87.  *    may be used to endorse or promote products derived from this software
  88.  *    without specific prior written permission.
  89.  *
  90.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  91.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  92.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  93.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  94.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  95.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  96.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  97.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  98.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  99.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  100.  * SUCH DAMAGE.
  101.  *
  102.  *    @(#)systm.h    7.17 (Berkeley) 5/25/91
  103.  */
  104.  
  105. #ifndef SYS_SYSTM_H
  106. #define SYS_SYSTM_H
  107.  
  108. #ifndef SYS_TYPES_H
  109. #include <sys/types.h>
  110. #endif
  111.  
  112. #ifndef SYS_CDEFS_H
  113. #include <sys/cdefs.h>        /* for the inlines */
  114. #endif
  115.  
  116. #include <stdarg.h>
  117.  
  118. /*
  119.  * queue node definition for _insque and _remque. _insque and _remque expect
  120.  * to find this structure from the start of every node they handle.
  121.  */
  122.  
  123. struct queue_node {
  124.   struct queue_node *next;
  125.   struct queue_node *prev;
  126. };
  127.  
  128. /* casts to keep lint happy */
  129. #define    insque(q,p)    _insque((struct queue_node *)q,(struct queue_node *)p)
  130.  
  131. static inline void 
  132. _insque(register struct queue_node *node, register struct queue_node *pred)
  133. {
  134.   node->next = pred->next;
  135.   node->prev = pred;
  136.   (pred->next)->prev = node;
  137.   pred->next = node;
  138. }
  139.  
  140. #define    remque(q)    _remque((struct queue_node *)q)
  141.  
  142. static inline struct queue_node *
  143. _remque(register struct queue_node *node)
  144. {
  145.   (node->next)->prev = node->prev;
  146.   (node->prev)->next = node->next;
  147.   return(node);
  148. }
  149.  
  150. /*
  151.  * General function declarations.
  152.  */
  153.  
  154. void cs_putchar(unsigned char, struct CSource *);
  155. void panic(const char *, ...);
  156. void log(unsigned long, const char *, ...);
  157. unsigned long vlog(unsigned long, const char *, va_list);
  158. unsigned long printf(const char *, ...);
  159. unsigned long sprintf(char * buf, const char * fmt, ...);
  160. unsigned long csprintf(struct CSource* buf, const char * fmt, ...);
  161. unsigned long vsprintf(char * buf, const char * fmt, va_list);
  162. unsigned long vcsprintf(struct CSource* buf, const char * fmt, va_list);
  163. char * csprintn(u_long n, int base, char *buf, int buflen);
  164. int  ultoa(unsigned long ul, char *buffer);
  165. int  ltoa(long l, char *buffer);
  166.  
  167. #define itoa(i,buffer) ltoa((long)i,buffer)
  168.  
  169. #ifndef AMIGA_SUBR_H
  170. #include <kern/amiga_subr.h>
  171. #endif
  172.  
  173. #endif /* !SYS_SYSTM_H */
  174.